import router from './index'
import { getToken } from '@/utils/token'
router.beforeEach((to, from, next) => {
  // ${//to and from are Route Object,next() must be called to resolve the hook}
  if (getToken() && to.path === '/login') {
    next(false)
  } else {
    next()
  }
})
